home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / Oberon / source / FPE / ToolDlgTpl.mod < prev   
Text File  |  1995-06-29  |  6KB  |  260 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: ToolDlgTpl.mod $
  4.   Description: Defines and implements the IntuiSup template for the tool
  5.                editor dialog.
  6.  
  7.    Created by: fjc (Frank Copeland)
  8.     $Revision: 1.8 $
  9.       $Author: fjc $
  10.         $Date: 1995/01/26 00:15:33 $
  11.  
  12.   Copyright © 1993-1994, Frank Copeland.
  13.   This file is part of FPE.
  14.   See FPE.doc for conditions of use and distribution.
  15.  
  16.   Log entries are at the end of the file.
  17.  
  18. ***************************************************************************)
  19.  
  20. <* MAIN- *> <*$ NilChk- *>
  21.  
  22. MODULE ToolDlgTpl;
  23.  
  24. IMPORT
  25.   SYS := SYSTEM, e := Exec, i := Intuition, is := IntuiSup, Data;
  26.  
  27.  
  28. (*------------------------------------*)
  29. (* Project Information *)
  30.  
  31. CONST
  32.  
  33.   LeftEdge * = 0;
  34.   TopEdge * = 0;
  35.   Width * = 465;
  36.  
  37. VAR
  38.   Height * : INTEGER;
  39.  
  40.  
  41. (*------------------------------------*)
  42. (* Gadget data *)
  43.  
  44. CONST
  45.  
  46.   NumGadgetDatas * = 11;
  47.  
  48. TYPE
  49.  
  50.   GadgetDataPtr * = POINTER TO GadgetData;
  51.  
  52.   GadgetData * = RECORD
  53.     g0 *  : is.InputData;
  54.     g1 *  : is.InputData;
  55.     g2 *  : is.InputData;
  56.     g3 *  : is.CheckData;
  57.     g4 *  : is.CheckData;
  58.     g6 *  : is.InputData;
  59.     g8 *  : is.InputData;
  60.     g9 *  : is.ButtonData;
  61.     g10 * : is.ButtonData;
  62.     dataEnd : LONGINT;
  63.   END; (* GadgetData *)
  64.  
  65.  
  66. (*------------------------------------*)
  67. (* Template data structure *)
  68.  
  69. TYPE
  70.  
  71.   Template * = RECORD
  72.     GadgetData * : GadgetDataPtr;
  73.   END; (* Template *)
  74.  
  75.  
  76. (*------------------------------------*)
  77. (* Local procedures *)
  78.  
  79.  
  80. (*------------------------------------*)
  81. (* Font data *)
  82.  
  83.  
  84. (*------------------------------------*)
  85. PROCEDURE TextHeight () : INTEGER;
  86.  
  87.   VAR scr : i.Screen;
  88.  
  89. BEGIN (* TextHeight *)
  90.   IF i.GetScreenData (scr, SIZE (i.Screen), {i.wbenchScreen}, NIL) THEN
  91.     RETURN scr.font.ySize
  92.   ELSE
  93.     RETURN 8
  94.   END
  95. END TextHeight;
  96.  
  97.  
  98. (*------------------------------------*)
  99. (* Gadget data *)
  100.  
  101. (*------------------------------------*)
  102. PROCEDURE InitGadgetData (gd : GadgetDataPtr);
  103.  
  104.   VAR textHeight : INTEGER;
  105.  
  106. BEGIN (* InitGadgetData *)
  107.   ASSERT (gd # NIL, 137);
  108.   textHeight := TextHeight ();
  109.  
  110.   gd.g0.type := is.string;
  111.   gd.g0.flags := {is.gdTextLeft, is.gdInputAutoActivate};
  112.   gd.g0.leftEdge := 128;
  113.   gd.g0.topEdge := textHeight + 7;
  114.   gd.g0.width := 115;
  115.   gd.g0.height := textHeight + 6;
  116.   gd.g0.text := SYS.ADR("Button");
  117.   gd.g0.textAttr := NIL;
  118.   gd.g0.len := Data.ButtonChars;
  119.   gd.g0.activateNext := 1;
  120.   gd.g0.activatePrev := 6;
  121.  
  122.   gd.g1.type := is.string;
  123.   gd.g1.flags := {is.gdTextLeft, is.gdInputAutoActivate};
  124.   gd.g1.leftEdge := 128;
  125.   gd.g1.topEdge := (2 * textHeight) + 16;
  126.   gd.g1.width := 325;
  127.   gd.g1.height := textHeight + 6;
  128.   gd.g1.text := SYS.ADR("Command");
  129.   gd.g1.textAttr := NIL;
  130.   gd.g1.len := Data.PathChars;
  131.   gd.g1.activateNext := 2;
  132.   gd.g1.activatePrev := 0;
  133.  
  134.   gd.g2.type := is.string;
  135.   gd.g2.flags := {is.gdTextLeft, is.gdInputAutoActivate};
  136.   gd.g2.leftEdge := 128;
  137.   gd.g2.topEdge := (3 * textHeight) + 25;
  138.   gd.g2.width := 325;
  139.   gd.g2.height := textHeight + 6;
  140.   gd.g2.text := SYS.ADR("Arguments");
  141.   gd.g2.textAttr := NIL;
  142.   gd.g2.len := Data.PathChars;
  143.   gd.g2.activateNext := 5;
  144.   gd.g2.activatePrev := 1;
  145.  
  146.   gd.g3.type := is.check;
  147.   gd.g3.flags := {is.gdTextRight};
  148.   gd.g3.leftEdge := 298;
  149.   gd.g3.topEdge := textHeight + 8;
  150.   gd.g3.width := 27;
  151.   gd.g3.height := textHeight + 3;
  152.   gd.g3.text := SYS.ADR("Active ?");
  153.   gd.g3.textAttr := NIL;
  154.  
  155.   gd.g4.type := is.check;
  156.   gd.g4.leftEdge := 13;
  157.   gd.g4.topEdge := (4 * textHeight) + 35;
  158.   gd.g4.width := 27;
  159.   gd.g4.height := textHeight + 3;
  160.  
  161.   gd.g6.type := is.string;
  162.   gd.g6.flags := {is.gdTextLeft, is.gdInputAutoActivate};
  163.   gd.g6.leftEdge := 128;
  164.   gd.g6.topEdge := (4 * textHeight) + 34;
  165.   gd.g6.width := 325;
  166.   gd.g6.height := textHeight + 6;
  167.   gd.g6.text := SYS.ADR("Console");
  168.   gd.g6.textAttr := NIL;
  169.   gd.g6.len := Data.ConsoleChars;
  170.   gd.g6.activateNext := 6;
  171.   gd.g6.activatePrev := 2;
  172.  
  173.   gd.g8.type := is.integer;
  174.   gd.g8.flags := {is.gdTextLeft, is.gdInputAutoActivate};
  175.   gd.g8.leftEdge := 128;
  176.   gd.g8.topEdge := (5 * textHeight) + 43;
  177.   gd.g8.width := 75;
  178.   gd.g8.height := textHeight + 6;
  179.   gd.g8.text := SYS.ADR("Stack");
  180.   gd.g8.textAttr := NIL;
  181.   gd.g8.len := 5;
  182.   gd.g8.activateNext := 0;
  183.   gd.g8.activatePrev := 5;
  184.   gd.g8.default := SYS.VAL (e.APTR, 4000);
  185.  
  186.   gd.g9.type := is.button;
  187.   gd.g9.leftEdge := 248;
  188.   gd.g9.topEdge := (6 * textHeight) + 52;
  189.   gd.g9.width := 100;
  190.   gd.g9.height := textHeight + 6;
  191.   gd.g9.text := SYS.ADR("Accept");
  192.   gd.g9.textAttr := NIL;
  193.  
  194.   gd.g10.type := is.button;
  195.   gd.g10.leftEdge := 353;
  196.   gd.g10.topEdge := (6 * textHeight) + 52;
  197.   gd.g10.width := 100;
  198.   gd.g10.height := textHeight + 6;
  199.   gd.g10.text := SYS.ADR("Cancel");
  200.   gd.g10.textAttr := NIL;
  201.  
  202.   gd.dataEnd := is.dataEnd;
  203. END InitGadgetData;
  204.  
  205.  
  206. (*------------------------------------*)
  207. (* Exported procedures *)
  208.  
  209.  
  210. (*------------------------------------*)
  211. PROCEDURE InitTemplate * (VAR template : Template);
  212.  
  213. BEGIN (* InitTemplate *)
  214.   Height := (7 * TextHeight()) + 64;
  215.   NEW (template.GadgetData);
  216.   InitGadgetData (template.GadgetData)
  217. END InitTemplate;
  218.  
  219.  
  220. (*------------------------------------*)
  221. PROCEDURE CleanupTemplate * (VAR template : Template);
  222.  
  223. BEGIN (* CleanupTemplate *)
  224.   SYS.DISPOSE (template.GadgetData)
  225. END CleanupTemplate;
  226.  
  227.  
  228. END ToolDlgTpl.
  229.  
  230. (***************************************************************************
  231.  
  232.   $Log: ToolDlgTpl.mod $
  233.   Revision 1.8  1995/01/26  00:15:33  fjc
  234.   - Release 1.5
  235.  
  236.   Revision 1.7  1994/09/25  18:20:54  fjc
  237.   - Uses new syntax for external code declarations
  238.  
  239.   Revision 1.6  1994/08/08  16:13:59  fjc
  240.   Release 1.4
  241.  
  242.   Revision 1.5  1994/06/17  17:32:19  fjc
  243.   - Updated for release
  244.  
  245.   Revision 1.4  1994/06/04  23:49:52  fjc
  246.   - Changed to use new Amiga interface
  247.  
  248.   Revision 1.3  1994/05/12  21:26:09  fjc
  249.   - Prepared for release
  250.  
  251.   Revision 1.2  1994/01/24  14:33:33  fjc
  252.   Changed version control header
  253.  
  254.   Revision 1.1  1994/01/15  17:32:38  fjc
  255.   Start of revision control
  256.  
  257. ***************************************************************************)
  258.  
  259.  
  260.